package freecomm.study.jumpactivity;

import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

/**
 * @author Junwei.Xu
 * 
 */
public class DirectActivity extends Activity
{
    private Button backButton;
    private TextView tv;
    private TextView tv2;

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.direct_activity);
        backButton = (Button) findViewById(R.id.directActivityBackButton);
        tv = (TextView) findViewById(R.id.directTV);
        tv2 = (TextView) findViewById(R.id.directTV2);
        Intent intent = this.getIntent();
        ComponentName cn = intent.getComponent();
        String packageName = cn.getPackageName();
        String className = cn.getClassName();
        tv.setText("package:" + packageName + "  class:" + className);
        if (null!=intent.getAction())
        {
            tv2.setText("Action:" + intent.getAction());
        }
        backButton.setOnClickListener(new OnClickListener()
        {

            @Override
            public void onClick(View v)
            {
                // TODO Auto-generated method stub
                Intent intent = new Intent(DirectActivity.this, JumpActivity.class);
                startActivity(intent);
                DirectActivity.this.finish();
            }
        });
    }
}
